package com.xinqi.modules.course.chapter.service;

import com.xinqi.common.mybatis.data.service.BaseService;
import com.xinqi.modules.course.chapter.domain.CourseChapterEntity;
import com.xinqi.modules.course.chapter.dto.ChapterImportDTO;
import com.xinqi.modules.course.chapter.dto.ChapterSortDTO;
import com.xinqi.modules.course.chapter.dto.req.ChapterQueryDTO;
import com.xinqi.modules.course.chapter.dto.req.ChapterTreeListQueryDTO;
import com.xinqi.modules.course.chapter.dto.req.InitChapterDTO;
import com.xinqi.modules.course.chapter.param.ChapterResponseDTO;
import com.xinqi.modules.course.chapter.dto.rsp.ChapterTreeDTO;

import java.util.List;
import java.util.Map;

/**
 * 课程章节表(CourseChapter)表服务接口
 *
 * @author liuxingxing
 * @since 2023-03-08 10:10:43
 */
public interface CourseChapterService extends BaseService<CourseChapterEntity> {

    void initChapter(InitChapterDTO param);

    void initChapterNew(InitChapterDTO param);

    void removeChapterAndContent(List<Long> idList);

    void sort(ChapterSortDTO sortParam);

    List<ChapterTreeDTO> treeList(ChapterTreeListQueryDTO treeListQueryParam);

    void importChapter(ChapterImportDTO importParam);

    List<ChapterResponseDTO> selectChapterOrSonChapter(ChapterQueryDTO queryParam);

    /**
     * 获取章节名称
     *
     * @param id 章节ID
     * @author lx
     */
    List<String> getChapterName(Long id);

    void saveCourseChapter(CourseChapterEntity courseChapter);

    Map<String, Object> chapterCount(Long classId);

    /**
     * 第x章/第x节/第x课时
     *
     * @param chapterId
     * @return
     */
    String selectName(Long chapterId);

    List<CourseChapterEntity> maxSortChapterList(List<Long> classIds);

}
